<template>
  <div
    class="card-box d-flex flex-column ai-center jc-start"
    :class="isSelect ? 'active' : ''"
  >
    <div class="img-box d-flex flex-column jc-center ai-center">
      <div class="img-box-inner">
        <MyImage :src="cardData.snap_path" alt width="140px" height="200px" />
        <span class="img-similar">{{ cardData.similarity }}%</span>
      </div>
      <span class="mt-10">{{ cardData.person_name }}</span>
    </div>
  </div>
</template>

<script>
import MyImage from "@/components/Image";
export default {
  components: { MyImage },
  props: {
    cardData: {
      type: Object,
      default: () => ({}),
    },
  },
  computed: {
    isSelect() {
      return this.cardData.isSelect;
    },
  },
};
</script>

<style lang="less" scoped>
.card-box {
  width: 142px;
  height: 220px;
  transition: all 0.1s;
  cursor: pointer;
  .img-box {
    background-color: rgba(242, 250, 255, 1);
    border-radius: 8px;
    height: 200px;
    border: 1px solid rgba(230, 237, 242, 1);
    width: 140px;
    &-inner {
      position: relative;
    }
    .img-similar {
      position: absolute;
      bottom: 4px;
      right: 2px;
      height: 20px;
      line-height: 20px;
      border: 1px solid;
      border-radius: 4px;
      font-size: 14px;
      padding: 0 2px;
      color: #fff;
    }
  }
  &.active {
    border: 1px solid #09c7aa;
  }
  .text-wrapper {
    width: 160px;
  }
}
</style>
